import Cookies from 'js-cookie';
import website from '@/config/website';
const Authorization = website.Authorization;
var inFifteenMinutes = new Date(new Date().getTime() + website.tokenTime * 1000);
// 获取指定名称的cookie
export function getToken() {
	return Cookies.get(Authorization);
}

// 创建一个名称为 Authorization，对应值为 token 的cookie，创建一个有效时间为 inFifteenMinutes 的cookie
export function setToken(token) {
	return Cookies.set(Authorization, token, { expires: inFifteenMinutes });
}

// 删除指定名称的cookie
export function removeToken() {
	return Cookies.remove(Authorization);
}
